﻿using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace TyMES.Communication.Request
{
    public class ScanMaterialRequest
    {
        /// <summary>
        /// 物料编码与SN的键值对
        /// 键: 物料编码 (对应前端的 AssemblyMaterialCode)
        /// 值: 物料序列号 (对应前端的 scannedSN)
        /// </summary>
        public Dictionary<string, string> MaterialBindings { get; set; } = new Dictionary<string, string>();

        /// <summary>
        /// 操作员ID (可选)
        /// </summary>
        public string OperatorId { get; set; }

        /// <summary>
        /// 仓库编码 (可选)
        /// </summary>
        public string WarehouseCode { get; set; }

        /// <summary>
        /// 所有物料BOM信息
        /// </summary>
        public List<MaterialBOMItem> MaterialBOM { get; set; } = new List<MaterialBOMItem>();

        public string StationCode { get; set; }
        public string LineCode { get; set; }
       

    }
    // 物料明细模型（对应前端 AllMaterialBOM 的单项）
    public class MaterialBOMItem
    {
        public string AssemblyMaterialCode { get; set; }  // 物料编码
        public string AssemblyMaterialName { get; set; }  // 物料名称
        public string AssemblyMaterialRegex { get; set; } // 物料正则
        public string ScannedSN { get; set; }            // 扫描的SN（可选）
    }
}
